﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using XProject.DataVisit.Factory;

namespace XProject.DataVisit.Model
{
    public class Area:IProjectModel
    {
        public virtual Guid PID { get; set; }
        /// <summary>
        /// 地区名称
        /// </summary>
        public virtual string AreaName { get; set; }
        /// <summary>
        /// 地区说明
        /// </summary>
        public virtual string AreaRemark { get; set; }
        
        public virtual Guid? ParentID { get; set; }
        /// <summary>
        /// 发布人
        /// </summary>
        public virtual Guid Creater { get; set; }
        /// <summary>
        /// 发布时间
        /// </summary>
        public virtual DateTime LastUpdate { get; set; }

        public virtual IList<Area> Children {
            get {
                if (PID != Guid.Empty)
                    return DaoFactory.AreaDao.GetListByKey(PID);
                return null;
            }
        }
    }
}
